# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Kevin MacMartin <prurigro@gmail.com>

pkgname=qtpass
pkgver=1.3.2
pkgrel=2
pkgdesc='A multi-platform GUI for pass'
url='https://qtpass.org/'
license=('GPL3')
arch=('loong64' 'x86_64')
depends=('qt5-base' 'pass' 'pwgen')
makedepends=('qt5-tools' 'qt5-svg')
validpgpkeys=('DF7FEF8DFBA721E320B18F5615B63ADCA0034B9E') # Anne Jan Brouwer (JinX) <brouwer@annejan.com>
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/IJHack/${pkgname}/archive/v${pkgver}.tar.gz"
	"${pkgname}-${pkgver}.tar.gz.asc::https://github.com/IJHack/${pkgname}/releases/download/v${pkgver}/v${pkgver}.tar.gz.asc")
sha256sums=('7a68e1afe68462c878c212a79c40ade5ba14b72710c5e62450cf54c7b5621254'
            'SKIP')

prepare() {
  cd "${srcdir}/QtPass-${pkgver}"

  sed -i 's|qtpass-icon|qtpass|' ${pkgname}.desktop
}

build() {
  cd "${srcdir}/QtPass-${pkgver}"

  qmake-qt5
  make
}

package() {
  cd "${srcdir}/QtPass-${pkgver}"

  install -D -m0755 main/qtpass "${pkgdir}/usr/bin/${pkgname}"
  install -D -m0644 artwork/icon.png "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
  install -D -m0644 ${pkgname}.desktop "${pkgdir}/usr/share/applications/${pkgname}.desktop"
  install -D -m0644 ${pkgname}.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
}

